package club.kingon.sql.builder.spring;

import club.kingon.sql.builder.SelectSqlBuilder;
import club.kingon.sql.builder.SqlBuilder;

import java.io.Serializable;
import java.util.List;

/**
 * @author dragons
 * @date 2021/12/10 16:07
 */
public interface BaseMapper<T> {

    int insert(T entity);

    List<T> selectList(SqlBuilder wrapper, SelectSqlBuilder selectSqlBuilder);

    List<T> selectList(SqlBuilder wrapper);

    int delete(Serializable ...primaries);

    int delete(SqlBuilder wrapper);

    int update(T entity, SqlBuilder wrapper);

    <P extends IPage<T>> P selectPage(P page, SqlBuilder wrapper);

    <P extends IPage<T>> P selectPage(P page, SqlBuilder wrapper, SelectSqlBuilder selectSqlBuilder);
}
